<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      * {
        padding: 0;
        margin: 0;
      }
      section {
        height: 40px;
        background-color: pink;
        margin: 0 auto;
        width: 100%;
        display: flex;
      }
      section div:nth-child(1) {
        width: 40px;
        height: 40px;
        background-color: purple;
      }
      section div:nth-child(2) {
        flex: 1;
      }
      section div:nth-child(3) {
        width: 40px;
        height: 40px;
        background-color: purple;
      }

      p {
        height: 30px;
        background-color: skyblue;
        display: flex;
      }
      p span {
        flex: 1;
      }
      p span:nth-child(2) {
        background-color: whitesmoke;
        flex: 2;
      }
    </style>
  </head>
  <body>
    <section>
      <div>1</div>
      <div>2</div>
      <div>3</div>
    </section>
    <p><span>1</span><span>2</span><span>3</span></p>
  </body>
</html>
